package launch.holder;



import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class DbgBuffStorage {

    private final Map<Integer, List<DbgBuffValueHolder>> buffs = new LinkedHashMap<Integer, List<DbgBuffValueHolder>>();
    private final Map<Integer, List<DbgCoolDownValueHolder>> coolDowns = new LinkedHashMap<Integer, List<DbgCoolDownValueHolder>>();
    private final Map<Integer, List<DbgDiseaseValueHolder>> diseases = new LinkedHashMap<Integer, List<DbgDiseaseValueHolder>>();

    public final void addBuffsToStorage(final int playerId, final List<DbgBuffValueHolder> toStore) {
	if (buffs.containsKey(playerId)) {
            buffs.remove(playerId);
        }
        buffs.put(playerId, toStore);
    }

    public final void addCooldownsToStorage(final int playerId, final List<DbgCoolDownValueHolder> toStore) {
	if (coolDowns.containsKey(playerId)) {
            coolDowns.remove(playerId);
        }
        coolDowns.put(playerId, toStore);
    }

    public final void addDiseaseToStorage(final int playerId, final List<DbgDiseaseValueHolder> toStore) {
	if (diseases.containsKey(playerId)) {
            diseases.remove(playerId);
        }
        diseases.put(playerId, toStore);
    }
    
    public final List<DbgBuffValueHolder> getBuffsFromStorage(final int playerId) {
        if (buffs.containsKey(playerId)) {
            return buffs.get(playerId);
        }
        return new ArrayList<DbgBuffValueHolder>();
    }

    public final List<DbgCoolDownValueHolder> getCooldownsFromStorage(final int playerId) {
        if (coolDowns.containsKey(playerId)) {
            return coolDowns.get(playerId);
        }
        return new ArrayList<DbgCoolDownValueHolder>();
    }

    public final List<DbgDiseaseValueHolder> getDiseaseFromStorage(final int playerId) {
        if (diseases.containsKey(playerId)) {
            return diseases.get(playerId);
        }
        return new ArrayList<DbgDiseaseValueHolder>();
    }
}
